PROGRAM MAPS
USE POLYMORPHIC_COMPLEXTAYLOR
TYPE(DAMAP) TOTAL_DA_MAP
REAL(DP) ANGLE,KICK_STRENGTH
type(tree) map_track,map_track_da
type(genfield) genmap
type(pbfield) h
real(dp) ray(6),ray_map(lnv)
real(dp) matrix(6,6)
integer mf,me
mf=20
open(unit=mf,file='results.txt')
CALL INIT(NO1=3,ND1=1,NP1=0,NDPT1 =0)     !   <------------------ init for maps in ND1 degrees of freedom

CALL ALLOC(TOTAL_DA_MAP)
ANGLE=31.0_DP * PI/180.0_DP
KICK_STRENGTH=3.0_DP

call alloc(h)

! This illustrates extraction and tracking with a matrix

h=0.03d0*((-angle/2.d0)*((1.d0.mono.'2')+(1.d0.mono.'02')) + KICK_STRENGTH*(1.d0.mono.'3')/3.d0)
TOTAL_DA_MAP=1
TOTAL_DA_MAP=texp(h,TOTAL_DA_MAP)



matrix=TOTAL_DA_MAP

! This contrasts contrasts the linear part of the map tracked by "matrix" with the total map

ray=0.d0;ray(1)=0.08d0;
ray_map=0.d0;ray_map(1)=0.08d0;

 write(mf,'(1x,4(1x,F7.5))') ray(1:2) ,ray_map(1:2)

! Here we track Total_map and the correspounding generating function
do i=1,600
 ray=matrix*ray
 ray_map=TOTAL_DA_MAP*ray_map
 write(mf,'(1x,4(1x,F7.5))') ray(1:2) ,ray_map(1:2)
enddo



CALL KILL(h)
CALL KILL(TOTAL_DA_MAP)
close(mf);
END PROGRAM MAPS

